package com.moji.controller.api;


import com.moji.common.base.ApiResult;
import com.moji.entity.MjAboutUs;
import com.moji.entity.MjFlowConfig;
import com.moji.entity.MjOpinion;
import com.moji.entity.dto.QueryFlowConfigDto;
import com.moji.entity.dto.QueryOpinionDto;
import com.moji.service.MjOpinionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 意见反馈表 前端控制器
 * </p>
 *
 * @author ccl
 * @since 2024-07-28
 */
@RestController
@RequestMapping("/api/mjOpinion")
@Api(tags = "意见反馈(申请体验)api相关接口", value = "意见反馈(申请体验)api相关接口")
public class MjOpinionController {

    @Resource
    private MjOpinionService mjOpinionService;

    @PostMapping("/add")
    @ApiOperation(value = "意见反馈(申请体验)_新增",response = Boolean.class)
    public ApiResult add(@Validated @RequestBody MjOpinion mjOpinion){
        return ApiResult.ok(mjOpinionService.add(mjOpinion));
    }

    @PostMapping("/edit")
    @ApiOperation(value = "意见反馈(申请体验)_编辑",response = Boolean.class)
    public ApiResult edit(@Validated @RequestBody MjOpinion mjOpinion){
        return ApiResult.ok(mjOpinionService.edit(mjOpinion));
    }

    @GetMapping("/delete")
    @ApiOperation(value = "意见反馈(申请体验)_删除",response = Boolean.class)
    public ApiResult delete(@RequestParam("id") Long id){
        return ApiResult.ok(mjOpinionService.delete(id));
    }

    @PostMapping("/queryByPage")
    @ApiOperation(value = "意见反馈(申请体验)_分页查询",response = MjOpinion.class)
    public ApiResult queryByPage(@RequestBody QueryOpinionDto dto){
        return ApiResult.ok(mjOpinionService.queryByPage(dto));
    }

    @PostMapping("/detail")
    @ApiOperation(value = "意见反馈(申请体验)_详情",response = MjOpinion.class)
    public ApiResult detail(@RequestParam("id") Long id){
        return ApiResult.ok(mjOpinionService.detail(id));
    }
}

